package com.example.azheng.okhttpdemo.adapter;

import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.azheng.okhttpdemo.R;
import com.example.azheng.okhttpdemo.beans.JuheBean;
import com.example.azheng.okhttpdemo.utils.GlideApp;
import com.example.azheng.okhttpdemo.utils.GlideImageLoader;
import com.youth.banner.Banner;

import java.util.ArrayList;
import java.util.List;

/**
 * @author azheng
 * @date 2018/4/14.
 * GitHub：https://github.com/RookieExaminer
 * email：wei.azheng@foxmail.com
 * description：
 */
public class RclyAdapter extends BaseQuickAdapter<JuheBean.ResultBean.DataBean, BaseViewHolder> {


    public RclyAdapter(int layoutResId, @Nullable List<JuheBean.ResultBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, JuheBean.ResultBean.DataBean item) {

        helper.setText(R.id.mTextView_item, item.getTitle());
        int height = (int) (100 + Math.random() * 150);
        GlideApp.with(mContext).load(item.getThumbnail_pic_s()).override(LinearLayout.LayoutParams.MATCH_PARENT, height).into((ImageView) helper.getView(R.id.mImage_item));


    }


}
